package com.lk.spring.boot.sample.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.lk.spring.boot.sample.bean.TestPOJO;
import com.lk.spring.boot.sample.dao.impl.TestImpl;

@RestController
public class TestController {

	@Autowired 
	private TestImpl testImpl;
	
	@RequestMapping("/test")
	public List<TestPOJO> getIndex(){
		return testImpl.queryAll();
	}
	@RequestMapping("{id}/get")
	public TestPOJO get(@PathVariable("id") int id){
		return testImpl.getByKey(id);
	}
}
